﻿CREATE TABLE [dbo].[Accounts_User_Normal_Permissions] (
    [User_GUID]   UNIQUEIDENTIFIER NOT NULL,
    [Object_GUID] UNIQUEIDENTIFIER NOT NULL,
    [Permission]  CHAR (1)         NOT NULL,
    CONSTRAINT [PK_Accounts_User_Normal_Permissions] PRIMARY KEY CLUSTERED ([User_GUID] ASC, [Object_GUID] ASC),
    CONSTRAINT [PERMISSION_TYPE_CK] CHECK ([permission]='r' OR [permission]='w'),
    CONSTRAINT [FK_Accounts_User_Normal_Permissions_Accounts_Secure_Objects] FOREIGN KEY ([Object_GUID]) REFERENCES [dbo].[Accounts_Secure_Objects] ([Object_GUID]),
    CONSTRAINT [FK_Accounts_User_Normal_Permissions_Accounts_User] FOREIGN KEY ([User_GUID]) REFERENCES [dbo].[Accounts_User] ([User_GUID])
);

